package cn.goodym.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import cn.goodym.po.Env;
import cn.goodym.service.EnvService;

/**
 * 添加用例
 * 
 * @author Administrator
 * 
 */
@Controller
@RequestMapping("/addcase")
public class AddCaseController {

	@Resource
	private EnvService envService;


	@RequestMapping("/showCase")
	public String showAddCase(Model model, Integer page) throws Exception {
		return "addcase/showCase";
	}

	@RequestMapping(value = "/addcase", method = { RequestMethod.GET })
	public String addCaseUI(Model model) throws Exception {
		List<Env> envList = envService.findAll();
		model.addAttribute("envList", envList);
		return "addcase/addCase";
	}
	
	
	
	@RequestMapping(value = "/add", method = { RequestMethod.POST })
	public String addCase2(@RequestParam("data")String data,
						@RequestParam("envId")String envId,
						@RequestParam("portName")String portName,
						@RequestParam("porturl")String porturl,
						@RequestParam("type")String type,
						@RequestParam("remark")String remark,
						@RequestParam("status")String status
						) throws Exception {

		return "addcase/showCase";
	}

}
